#ifdef __APPLE__
        #include <OpenGL/gl.h>
        #include <OpenGL/glu.h>
        #include <GLUT/glut.h>
#else
	#ifdef _WIN32
        #include "../glut.h"
	#else
        #include <GL/gl.h>
        #include <GL/glu.h>
        #include <GL/glut.h>
	#endif
#endif

#include <iostream>
#include "../inc/Point.h"

using namespace std;

Point::Point()
{
	x = 0;
	y = 0;
}

Point::Point(int _x, int _y)
{
	x = _x;
	y = _y;
}

Point::Point( const Point &_p)
{
	x = _p.x;
	y = _p.y;
}

Point::~Point()
{
	
}

Point Point::operator=(const Point &_p)
{
	return Point ( _p.x, _p.y );
}

bool Point::operator ==(const Point &_p)
{
	if ( x == _p.x && y == _p.y )
		return true;
	
	else
		return false;
}

int Point::getX()
{
	return x;
}

int Point::getY()
{
	return y;
}

void Point::setX(int _x)
{
	x = _x;
}

void Point::setY(int _y)
{
	y = _y;
}

void Point::setXY(int _x, int _y)
{
	x = _x;
	y = _y;
}

bool Point::isNear(Point _p)
{
	if ( abs( x - _p.getX() ) < 10 && abs( y - _p.getY() ) < 10 )
		return true;
	
	else 
		return false;
}

void Point::print()
{
	cout<<"Point ("<<x<<","<<y<<")"<<endl;
}

void Point::display()
{
	glBegin(GL_POINTS);
		glVertex2i ( x, y );
	glEnd();
}

void Point::display(float _r, float _g, float _b)
{
	glColor3f(_r, _g, _b);
	glBegin(GL_POINTS);
		glVertex2i (x,y);
	glEnd();
}
